package com.ruoyi.project.system.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.project.system.mapper.TChoiceMapper;
import com.ruoyi.project.system.domain.TChoice;
import com.ruoyi.project.system.service.ITChoiceService;

/**
 * 选项Service业务层处理
 * 
 * @author ruoyi
 * @date 2020-05-09
 */
@Service
public class TChoiceServiceImpl implements ITChoiceService 
{
    @Autowired
    private TChoiceMapper tChoiceMapper;

    /**
     * 查询选项
     * 
     * @param choiceId 选项ID
     * @return 选项
     */
    @Override
    public TChoice selectTChoiceById(Integer choiceId)
    {
        return tChoiceMapper.selectTChoiceById(choiceId);
    }

    /**
     * 查询选项列表
     * 
     * @param tChoice 选项
     * @return 选项
     */
    @Override
    public List<TChoice> selectTChoiceList(TChoice tChoice)
    {
        return tChoiceMapper.selectTChoiceList(tChoice);
    }

    /**
     * 新增选项
     * 
     * @param tChoice 选项
     * @return 结果
     */
    @Override
    public int insertTChoice(TChoice tChoice)
    {
        tChoice.setCreateTime(DateUtils.getNowDate());
        return tChoiceMapper.insertTChoice(tChoice);
    }

    /**
     * 修改选项
     * 
     * @param tChoice 选项
     * @return 结果
     */
    @Override
    public int updateTChoice(TChoice tChoice)
    {
        return tChoiceMapper.updateTChoice(tChoice);
    }

    /**
     * 批量删除选项
     * 
     * @param choiceIds 需要删除的选项ID
     * @return 结果
     */
    @Override
    public int deleteTChoiceByIds(Integer[] choiceIds)
    {
        return tChoiceMapper.deleteTChoiceByIds(choiceIds);
    }

    /**
     * 删除选项信息
     * 
     * @param choiceId 选项ID
     * @return 结果
     */
    @Override
    public int deleteTChoiceById(Integer choiceId)
    {
        return tChoiceMapper.deleteTChoiceById(choiceId);
    }
}
